Integrand size = 19, antiderivative size = 66 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{a d}+\frac {b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{a \sqrt {a^2+b^2} d} \]
-arctanh(cos(d*x+c))/a/d+b*arctanh((b*cos(d*x+c)-a*sin(d*x+c))/(a^2+b^2)^( 1/2))/a/d/(a^2+b^2)^(1/2)
Time = 0.35 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.14 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {-\frac {2 b \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a d} \]
((-2*b*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]])/Sqrt[a^2 + b^2] - Log[Cos[(c + d*x)/2]] + Log[Sin[(c + d*x)/2]])/(a*d)
Time = 0.40 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3042, 4001, 3042, 3589, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sin (c+d x) (a+b \tan (c+d x))}dx\) |
\(\Big \downarrow \) 4001 |
\(\displaystyle \int \frac {\cot (c+d x)}{a \cos (c+d x)+b \sin (c+d x)}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (c+d x)}{\sin (c+d x) (a \cos (c+d x)+b \sin (c+d x))}dx\) |
\(\Big \downarrow \) 3589 |
\(\displaystyle \int \left (\frac {\csc (c+d x)}{a}-\frac {b}{a (a \cos (c+d x)+b \sin (c+d x))}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {b \text {arctanh}\left (\frac {b \cos (c+d x)-a \sin (c+d x)}{\sqrt {a^2+b^2}}\right )}{a d \sqrt {a^2+b^2}}-\frac {\text {arctanh}(\cos (c+d x))}{a d}\) |
-(ArcTanh[Cos[c + d*x]]/(a*d)) + (b*ArcTanh[(b*Cos[c + d*x] - a*Sin[c + d* x])/Sqrt[a^2 + b^2]])/(a*Sqrt[a^2 + b^2]*d)
3.1.56.3.1 Defintions of rubi rules used
Int[(cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.))/(cos[(c_. ) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :> Int[Ex pandTrig[cos[c + d*x]^m*(sin[c + d*x]^n/(a*cos[c + d*x] + b*sin[c + d*x])), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IntegersQ[m, n]
Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _.), x_Symbol] :> Int[Sin[e + f*x]^m*((a*Cos[e + f*x] + b*Sin[e + f*x])^n/C os[e + f*x]^n), x] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && ILtQ [n, 0] && ((LtQ[m, 5] && GtQ[n, -4]) || (EqQ[m, 5] && EqQ[n, -1]))
Time = 0.75 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.95
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{a \sqrt {a^{2}+b^{2}}}}{d}\) | \(63\) |
default | \(\frac {\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {2 b \,\operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{a \sqrt {a^{2}+b^{2}}}}{d}\) | \(63\) |
risch | \(-\frac {i b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, d a}+\frac {i b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i b +a}{\sqrt {-a^{2}-b^{2}}}\right )}{\sqrt {-a^{2}-b^{2}}\, d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a d}\) | \(150\) |
1/d*(1/a*ln(tan(1/2*d*x+1/2*c))-2*b/a/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan (1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2)))
Leaf count of result is larger than twice the leaf count of optimal. 183 vs. \(2 (62) = 124\).
Time = 0.31 (sec) , antiderivative size = 183, normalized size of antiderivative = 2.77 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\sqrt {a^{2} + b^{2}} b \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - {\left (a^{2} + b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a^{2} + b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{3} + a b^{2}\right )} d} \]
1/2*(sqrt(a^2 + b^2)*b*log((2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)* cos(d*x + c)^2 - 2*a^2 - b^2 - 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin(d *x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) - (a^2 + b^2)*log(1/2*cos(d*x + c) + 1/2) + (a^2 + b^2)*log(-1/2*cos (d*x + c) + 1/2))/((a^3 + a*b^2)*d)
\[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\int \frac {\csc {\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \]
Time = 0.52 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.62 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{\sqrt {a^{2} + b^{2}} a} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a}}{d} \]
(b*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*si n(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*a) + lo g(sin(d*x + c)/(cos(d*x + c) + 1))/a)/d
Time = 0.43 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.42 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\frac {b \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} a} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a}}{d} \]
(b*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan (1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*a) + log(ab s(tan(1/2*d*x + 1/2*c)))/a)/d
Time = 4.91 (sec) , antiderivative size = 174, normalized size of antiderivative = 2.64 \[ \int \frac {\csc (c+d x)}{a+b \tan (c+d x)} \, dx=\frac {\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {2\,b\,\mathrm {atanh}\left (\frac {\sqrt {a^2+b^2}\,\left (1{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+2{}\mathrm {i}\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+4{}\mathrm {i}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2\right )}{b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,4{}\mathrm {i}+a\,b^2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}+a^2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,3{}\mathrm {i}+a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a^2+b^2\right )\,1{}\mathrm {i}}\right )}{a\,d\,\sqrt {a^2+b^2}} \]
log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))/(a*d) - (2*b*atanh(((a^2 + b^2) ^(1/2)*(a^2*sin(c/2 + (d*x)/2)*1i + b^2*sin(c/2 + (d*x)/2)*4i + a*b*cos(c/ 2 + (d*x)/2)*2i))/(b^3*sin(c/2 + (d*x)/2)*4i + a*b^2*cos(c/2 + (d*x)/2)*1i + a^2*b*sin(c/2 + (d*x)/2)*3i + a*cos(c/2 + (d*x)/2)*(a^2 + b^2)*1i)))/(a *d*(a^2 + b^2)^(1/2))